package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119604206";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCAztiW8QbZyYNIv1l3yYq8aOW/+vw1RhylmHNOcShTs1+IrcflJgwo9uCa+Njjlch9QbyuTfbRsLfFNZHOixcpuMZt7lhm+1/TZ/2wZeyIaIA5CRV3h3xmPliLLLpDH/Sy0vr9QS+p/joPdCiGdUrWG3l6ZL77zii0NpMEE6E1lBcCt6SOgO5mOhJRUII/e4fSwnZpv8HYevYZpvVeLLuH2RPtLJD2WJMQlM1J3TxoEFtQTC2fTwPpQsujlMQx+4P3KFXjvUOyNm4WYkNEjCOfPsQSy3GAKwbbzNJFwOpb3dVAZl9/T2SrXk1EJN2QsXCKyIgF8ScCutmpEvHYpzmFAgMBAAECggEAYFDLWgq+saliFsqmbtDwgbP6YBSf9IIJt7WIOxaYLgZJoF05xNova443IwqCu6LruOWn3bqEngWDVN6auZP97P+yuM7poY/D9sOiyf1c4h8qCfwF5kwUNCvYb7ExUjIZ+oGSlj7hEj78UUPtbaVVIUaIDoI44PcmLqNESV8YQ4P2vyoD/hcOjlLKSTLeRKWWjL9J3kY21Y8hfZZoszpYtztNe+H8rlUj121nSRfyFyRJqAqzm4ovdAM8j5q/iD2SMa3Ij/Oaxcgc99EKGSIlQnQRTgy5T0aGKNweXl1ycwBdkn4Epb65KIuRe5mgeyOZX+zDPSty2pfUHJGHo+n4PQKBgQDUowmjKy1Y4ZAuafhQVkcBseoXLxDdr5qklsYZnANo9ufMrZN2M3Aa7n8mtAnPx7x6YZ39nRyL2HspI8/janUtN9p+7FJEPKvcdqnFjb55TivzJ/bP5kg6WwHBmBCzA7DPJt4iBy2FeybiNZhTLMGooVcHZcwTACUTyckFonck1wKBgQCbE2vv7dGNGbY123A1AY4GY+6eG2grM5Hium+HRfYrej6KyGPf7BmUKsqoN78WJKoHKNeS1DOHjbUHfU0+VdXTBh7BQydtbThZrPqhzN47z6tN/Rk+/Q2cs679i7p2Gks5yqG2HicnXHL7ShX6LH/lkMgatjUNiuk81dcqvXgtAwKBgQDMoR3cLegU+fWEBS0XOwBYbDwoFX44qQ68R/Daol5RvBK00XHwtW20LUKmH2q1z7TdXWXqtDDNkAZuP+2HIGMlofOeY5SD4JNPtc6JtG/SU11OQm5uAmIN7pjREqM3c1zK7c+llZzEMRDpbsRpfs/blXCoSNnMiz4jPfQ7fO8FvwKBgDbGpHCqU0OA2oCpkzfV5cHSGJ4WVjQ0UgqBChYBG1P+KQtCfyzAK8TPXKgQkNmUd85xmbvOYqk138TWeKtVDGMunTxsqQeY9bePRzRRtgnwb7TrerhqEB3SxjPe4C0JWpr+PSKkAfaATEkAwUSN5VtESbpNs+2lrH8FlawOIt3bAoGAXDe2sjjW38jdv36wJptfJPzYZCDYxeL/+OPBRKjzy7aT5r+I3Zq6TDuR/d0uUOPyOL1UA3rDVQZzvdbO65uV0TH0wtmezIWRqurV0YR2wrdEbgQ7lDl/Hrxh0WkVK+WliVC3z3GBJbXBSDbGUQLeETHh9fZU7M29jhR6l1LHIIw=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoYNjxnFJiKJ0rsyqAwjbG6w/pLpXmBxEBw8vgJxJeJedqhv0XjqDkuss2dH77j1nfzPLCy2ZVc0XyeSBf7bZ6TaRPrGSdFHkPvkvYZiMKIl/7DN01YGvcfeOWjHqJaGZojQ8M3J7Y30yIHz6NJxMw0lBjZAgxRlIen6MCKy8QD8LiUdlk+v/Qlfsz1ltEWWvbp0Xo4mOgRINbcnkVYhtsY3ehji3I1oN6EoZVOxeVyrnGQewrQQJXvERqLfmAylbjyhVE46ohBi47e7HCda3WhEvMf7zZhwCB44iAjlhL9XWbOjys5cAnnK5Ec7gom0vHxE4P/sxQP7cOhP5lwYGJwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://mcbaiv.natappfree.cc/orderserver/movieOrder/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8891/swagger-ui.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

